import 'package:seedfour/generated/json/base/json_convert_content.dart';
import 'package:seedfour/app/models/sms_entity.dart';

SmsEntity $SmsEntityFromJson(Map<String, dynamic> json) {
  final SmsEntity smsEntity = SmsEntity();
  final int? ttl = jsonConvert.convert<int>(json['ttl']);
  if (ttl != null) {
    smsEntity.ttl = ttl;
  }
  final String? ttlDesc = jsonConvert.convert<String>(json['ttlDesc']);
  if (ttlDesc != null) {
    smsEntity.ttlDesc = ttlDesc;
  }
  final String? message = jsonConvert.convert<String>(json['message']);
  if (message != null) {
    smsEntity.message = message;
  }
  return smsEntity;
}

Map<String, dynamic> $SmsEntityToJson(SmsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['ttl'] = entity.ttl;
  data['ttlDesc'] = entity.ttlDesc;
  data['message'] = entity.message;
  return data;
}

extension SmsEntityExtension on SmsEntity {
  SmsEntity copyWith({
    int? ttl,
    String? ttlDesc,
    String? message,
  }) {
    return SmsEntity()
      ..ttl = ttl ?? this.ttl
      ..ttlDesc = ttlDesc ?? this.ttlDesc
      ..message = message ?? this.message;
  }
}